<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="layui-v2.6.8/layui/css/layui.css">
    <script src="layui-v2.6.8/layui/layui.js"></script>
    <script src="jq/jquery1.9/jquery-1.9.0.js"></script>
</head>

<body>

    <div class="layui-container">
        <table class="layui-table">
           
            <thead>
                <tr>
                    <th>编号</th>
                    <th>用户名</th>
                    <th>年龄</th>
                </tr>
            </thead>
            <tbody>
              
            </tbody>
        </table>
    </div>
    <script>
        var objs = [
            {
                id: 1001,
                name: "alice",
                age: 30
            },
            {
                id: 1002,
                name: "tom",
                age: 40
            }
        ];
        for(var i=0;i<objs.length;i++){
            var tr=$("<tr></tr>");
            var td1=$("<td>"+objs[i].id+"</td>");
            var td2=$("<td>"+objs[i].name+"</td>");
            var td3=$("<td>"+objs[i].age+"</td>");
            tr.append(td1);
            tr.append(td2);
            tr.append(td3);
            $("tbody").append(tr);
        }

    </script>
</body>

</html>